import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', {
  state: () => ({
    userInfo: {}
  }),

  actions: {
    setUserInfo(userInfo) {
      this.userInfo = userInfo
    },

    logout() {
      this.userInfo = {}
      localStorage.removeItem('token')
    }
  }
})
